<!--
  @author tanghongjun
  @since 2018/10/19 08:59
-->
<!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org">

<head th:include="common/common :: jscss">
    <title>产品管理</title>
</head>
<style type="text/css">
    .one-text{
        border-radius: 1px;border: 1px solid #d2d2d2;position: absolute;left: 0;line-height: inherit;text-align: center;
    }
    .width-100{
        width: 100%;
    }
    .text-disabled{
        color: #d2d2d2 !important; cursor: not-allowed !important;background: white;
    }
    .text-enable{
        color: #666 !important;
    }
    tr td .one-text:hover{
        background:#f2f2f2  !important;
    }
    tr td .two-text:hover{
        background:#f2f2f2  !important;
    }

    .two-text{
        border-radius: 1px;border: 1px solid #d2d2d2;position: absolute;line-height: inherit;width: 45%;text-align: center
    }

    .two-text-left{
        left: 0;
    }
    .two-text-right{
        right: 0;
    }

</style>
<body>

<div class="layui-fluid">
    <blockquote class="layui-crumb">
        <a lay-href="/service/tariff/list.action">价格表管理></a>
        <zmn th:text="(${faultTariff == null || faultTariff.tariffName == null}) ? '' : ${faultTariff.tariffName}+'>'">价格表名称</zmn>
        <a th:lay-href="|/product/tariff/list.action?tariffId=${faultTariff.tariffId}&flag=4|">产品基础价格</a>>
        <zmn th:text="(${servProductVO.name} == null) ? '' : ${servProductVO.name}+'>'">产品名称</zmn>
        <zmn>产品价格表</zmn>
    </blockquote>

    <div class="layui-card">
        <div th:replace="product/service/group/_table::table"></div>
        <div class="layui-form-item submit" th:if="${faultTariff.tariffType != 4}" >
            <div class="layui-input-inline" style="margin-left: 10px">
                <button th:if="${#authPermit.checkPermit('/product/tariff/item/batchAddEdit.action')}" class="layui-btn" lay-submit="" lay-filter="zmn-form-submit">
                    确定
                </button>
                <button type="reset" class="layui-btn layui-btn-primary"
                        onclick="cancel()">取消
                </button>
            </div>

            <div class="layui-input-inline" style="width:420px;">
                <label  style="color: #9F9F9F;">
                    内部结算价：用于ERP财务系统，与：工程师、子公司之间的结算
                    外部结算价：说明：用于与：渠道、厂商、政企之间的结算
                </label>
            </div>
        </div>
        <div class="layui-split">&nbsp;</div>
    </div>

</div>
</body>
</html>

<script type="application/javascript">
    function format (num) {
        return num.toString().replace(/\d+/, function (n) { // 先提取整数部分
            return n.replace(/(\d)(?=(\d{3})+$)/g, function ($1) { // 对整数部分添加分隔符
                return $1 + ",";
            });
        });
    }
</script>

<script type="text/html" id="switchTpl">

    <div>
        {{#  if(d.priceStandard.indexOf('非一口价')!=-1){ }}
        <input type="text" style="text-align: right" name="negotiableMinPrice" class="two-text two-text-left text-disabled" value="{{format(d.negotiableMinPrice)}}">
        <span style="width: 10%">-</span>
        <input type="text" style="text-align: right" name="negotiableMaxPrice" class="two-text two-text-right text-disabled" value="{{format(d.negotiableMaxPrice)}}">
        {{#  } else { }}
        <input type="text" name="price" class="one-text width-100 text-enable" style="text-align: right" value="{{format(d.price)}}">
        {{#  } }}
    </div>
</script>

<script type="text/html" id="internalSettlementPriceTpl">
    <div>
        <input type="text" name="internalSettlementPrice" class="one-text width-100 text-enable" style="text-align: right" value="{{format(d.internalSettlementPrice)}}">
    </div>
</script>

<script type="text/html" id="externalSettlementPriceTpl">
    <div>
        <input type="text" name="externalSettlementPrice" class="one-text width-100 text-enable" style="text-align: right" value="{{format(d.externalSettlementPrice)}}">
    </div>
</script>

<script type="text/html" id="trafficFeeTpl">
    <div>
        <input type="text" readonly  unselectable="on" name="trafficFee" class="one-text width-100" style="text-align: right;color: #666 !important;" value="{{format(d.trafficFee)}}">
    </div>
</script>

<script type="text/html" id="hourFeeTpl">
    <div>
        <input type="text" readonly  unselectable="on" name="hourFee" class="one-text width-100 layui-gray" style="text-align: right;color: #666 !important;" value="{{format(d.hourFee)}}">
    </div>
</script>

<script type="text/html" id="checkFeeTpl">
    <div>
        <input type="text" readonly  unselectable="on" name="checkFee" class="one-text width-100 layui-gray" style="text-align: right;color: #666 !important;" value="{{format(d.checkFee)}}">
    </div>
</script>

<script type="text/html" id="servicePriceTpl">
    <div>
        <input type="text" readonly  unselectable="on" name="servicePrice" class="one-text width-100 layui-gray" style="text-align: right;color: #666 !important;" value="{{format(d.servicePrice)}}">
    </div>
</script>

<script type="text/html" id="partPriceTpl">
    <div>
        <input  type="text" readonly unselectable="on" name="partPrice" class="one-text width-100 layui-gray" style="text-align: right;color: #666 !important;" value="{{format(d.partPrice)}}">
    </div>
</script>

<script type="text/html" id="artPriceTpl">
    <div>
        <input  type="text" readonly unselectable="on" name="artPrice" class="one-text width-100 layui-gray" style="text-align: right;color: #666 !important;" value="{{format(d.artPrice)}}">
    </div>
</script>


<script type="text/html" id="guaranteePriceTpl">
    <div>
        <input  type="text" readonly unselectable="on" name="guaranteePrice" class="one-text width-100 layui-gray" style="text-align: right;color: #666 !important;" value="{{format(d.guaranteePrice)}}">
    </div>
</script>


<script type="text/html" id="generalTpl">
    {{#  if(d.general.indexOf('非默认') != -1){ }}
    {{ d.general }}
    {{#  } else { }}
    <span style="color: #FF0000">{{ d.general }}</span>
    {{#  } }}
</script>

<script type="text/javascript" th:inline="javascript">

    var json = {
        productFaultGroupVOList: [[${productFaultGroupVOList}]],
        productId: [[${productId}]],
        tariffId: [[${tariffId}]],
        general: [[${general}]],
        faultTariff: [[${faultTariff}]],
        productFaultTariff: [[${productFaultTariff}]]
    };

    layui.config({
        version: 20191127,
        base: "/static/lay/"
    }).extend({
        index: "lib/index",
        serv_product_tariff_group_list: "product/service/group/zmn.product.tariff.group.list",
    }).use(['index', 'serv_product_tariff_group_list']);

</script>